import re
import os
import time
import shutil
dir='/vdb/python/zimu_blog/log'
dir_file_list=os.listdir(dir)
re_file_com=re.compile('uwsgi\d?.log')
base_path='/ossfs/zimu/'+time.strftime('%Y-%m-%d',time.localtime())
if not os.path.exists(base_path):
    os.mkdir(base_path)
for file in dir_file_list:
    filename=os.path.join(dir,file)
    with open(filename,'r+') as f:
        context=f.read()
        f.write('')
    with open(os.path.join(base_path,file),'w') as f:
        f.write(context)